﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OptusMobile.Web.ServerComponents.BAL.Authentication;

namespace OptusMobile.Web.ManagerPortal
{
    public partial class ManagerLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        private LoginManager loginmanager;
        
        private void cancel()
        {
            this.tbID.Text = "";
            this.tbPWD.Text = "";
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            loginmanager = new LoginManager();
            bool status = loginmanager.AdminAuthenticate(this.tbID.Text, this.tbPWD.Text);
            if (status == true)
            {
                Session["ID"] = this.tbID.Text;
                Session["password"] = this.tbPWD.Text;
                Session["flag"] = "admin";
                this.Response.Redirect("ReContract.aspx");
            }
            else
            {
                this.cancel();
                
            }
        }
    }
}
